package ai.plantdata.Creation.mode.FactoryMethod.test;

import ai.plantdata.Creation.mode.FactoryMethod.factory.ShapeFactory;
import ai.plantdata.Creation.mode.FactoryMethod.interfaces.Shape;

/**
 * @Author: WangHui
 * @Date: 2020/12/18 11:19
 * @Description:
 */
public class FactorPatternDemo {
    public static void main(String[] args) {
        ShapeFactory shapeFactory = new ShapeFactory();
        Shape circle = shapeFactory.getShape("CIRCLE");
        circle.draw();
        Shape rectangle = shapeFactory.getShape("RECTANGLE");
        rectangle.draw();
        Shape square = shapeFactory.getShape("SQUARE");
        square.draw();
    }
}
